package com.charlotte.study.gupao.observer.gper;


import java.util.Observable;

/**
 * 主题类(被观察者)
 * @author junjie.ding
 * @date 2020/3/24
 */
public class Gper extends Observable {

    private String name = "Gper 生态圈";

    private static Gper gper = null;

    public static Gper getInstance(){
        if(gper == null){
            gper = new Gper();
        }
        return gper;
    }

    private Gper() {
    }

    public String getName() {
        return name;
    }

    public void publishQuestion(Question question){
        System.out.println("发布问题：" + question.toString());
        super.setChanged();
        super.notifyObservers(question);
    }
}
